#version 330 core

in vec2 TexCoords;

uniform float Time;
uniform vec2 MousePos;
uniform vec2 Size;
uniform sampler2D image;
uniform sampler2D imageNoise;
uniform sampler2D imageNoise2;
uniform float DrawBg;
uniform sampler2D Color;

out vec4 FragColor;

void main()
{
	float speed1 = 0.2f;
	float speed2 = 0.1f;
	float scale = 0.4; //abs(sin(Time*speed1));
	float noise_color = texture2D(imageNoise, TexCoords - Time * speed1).r;
	float noise_color2 = texture2D(imageNoise2, TexCoords - Time * speed2).g;

	float e = ( noise_color * noise_color2 ) - (TexCoords.y) * scale;

	vec4 img_color = texture2D(image, TexCoords);
	FragColor = texture2D(Color, vec2(e));
	
}
